<template>
  <div class="container">
    <van-nav-bar
      title="我的"
      style="z-index: 1001"
      fixed
    >
    </van-nav-bar>

    <div class="grid">
      <div class="item" @click="clickItem(1)">
        <span>1</span>
        <span>收到的邀约</span>
      </div>
      <div class="item" @click="clickItem(2)">
        <span>1</span>
        <span>发出的邀约</span>
      </div>
      <div class="item" @click="clickItem(3)">
        <span>1</span>
        <span>邀约成功</span>
      </div>
    </div>

    <div class="list">
      <div class="item">
        <span>账号</span>
        <span>BH00001</span>
      </div>

      <p class="line"></p>

      <div class="item">
        <span>邂逅宣言 </span>
        <span>在北京遇到爱情 </span>
      </div>
    </div>

    <div style="margin: 80px 20px 0 20px">
      <van-button
        @click="cliceSign"
        :disabled="disabled"
        style="marigin: 20px"
        color="#55A79A"
        type="primary"
        block
        >{{ disabled ? '已签到' : '签到赴约' }}</van-button
      >
    </div>
    <van-tabbar v-model="active" active-color="#42b983" inactive-color="#000">
      <van-tabbar-item @click="router('/orderlist')" icon="wap-home-o"
        >首页</van-tabbar-item
      >
      <van-tabbar-item @click="router('/my')" icon="contact"
        >我的</van-tabbar-item
      >
    </van-tabbar>
  </div>
</template>

<script>
import { Dialog } from 'vant';
export default {
  data() {
    return {
      disabled: false,
      active:1
    };
  },
  methods: {
    cliceSign() {
      Dialog.alert({
        title: '签到',
        message: '您已签到成功，请准时赴约！',
        theme: 'round-button',
      }).then(() => {
        this.disabled = true;
      });
    },
    router(path) {
      this.$router.push(path);
    },
    clickItem(type) {
      switch (type) {
        case 1:
          this.$router.push('/my/received');
          break;

        case 2:
          this.$router.push('/my/send');
          break;

        case 3:
          this.$router.push('/my/success');
          break;
      }
    },
  },
};
</script>

<style lang="scss" scoped>
.container {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding-top: 44px;
  box-sizing: border-box;
}

.grid {
  margin: 15px 0;
  display: flex;
  flex-direction: row;
  background-color: white;

  & > .item {
    display: flex;
    flex: 1;
    padding: 8px 0;
    text-align: center;
    flex-direction: column;
    & > span:first-child {
      color: black;
      font-size: 18px;
      margin-bottom: 5px;
      font-weight: bold;
    }

    & > span:last-child {
      color: gray;
      font-size: 16px;
    }
  }
}

.line {
  height: 1px;
  background-color: #e5e5e5;
}
.list {
  display: flex;
  flex-direction: column;
  padding: 5px 10px;
  background-color: white;

  & > .item {
    display: flex;
    padding: 8px 0;
    align-items: center;
    flex-direction: row;
    & > span:first-child {
      color: black;
      font-size: 16px;
      flex: 1;
    }

    & > span:last-child {
      color: gray;
      font-size: 16px;
    }
  }
}
</style>